package com.syher.quartz.core.config.quartz.job;

import org.quartz.InterruptableJob;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Created by shenyuhang on 2018/3/7.
 */
public abstract class AsyncJob implements InterruptableJob {

    private volatile Thread currentThread;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        currentThread = Thread.currentThread();
        doExecute(context);
    }

    public abstract void doExecute(JobExecutionContext context) throws JobExecutionException;
}
